import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    // url: '/api/rb-oem/oem/serviceTemplate/service_template/list',
    url: '/api/rb-oem/oem/oempolicy/oem_policy/templateList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (row) => {
  return request({
    // url: '/api/rb-oem/oem/serviceTemplate/service_template/detail',
    url: '/api/rb-oem/oem/oempolicy/oem_policy/serviceTemplatePolicyDetailV2',
    method: 'post',
    data: row
  })
}

export const remove = (id) => {
  return request({
    url: '/api/rb-oem/oem/serviceTemplate/service_template/removeV2',
    method: 'post',
    params: {
      id,
    }
  })
}

/* 新增/修改模板政策 */
export const add = (row) => {
  return request({
    // url: '/api/rb-oem/oem/serviceTemplate/service_template/submit',
    url: '/api/rb-oem/oem/oempolicy/oem_policy/addPolicyTemplateV2',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    // url: '/api/rb-oem/oem/serviceTemplate/service_template/submit',
    url: '/api/rb-oem/oem/oempolicy/oem_policy/addPolicyTemplateV2',
    method: 'post',
    data: row
  })
}

/* export const getTemplateDetail = (aisleCode) => {
  return request({
    url: '/api/rb-oem/oem/oempolicy/oem_policy/aisleDetail',
    method: 'get',
    params: {
      aisleCode
    }
  })
} */

export const getTemplateDetail = (aisleCode) => {
  return request({
    url: '/api/rb-oem/oem/oempolicy/oem_policy/servicePolicyFrame',
    method: 'post',
    params: {
      aisleCode
    }
  })
}